/* 全局样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f9e6f0; /* 浅粉色背景 */
    color: #5e3a4d; /* 深粉色文字 */
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* 背景动画 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(255, 182, 193, 0.2), rgba(255, 105, 180, 0.2));
    z-index: -1;
    animation: backgroundAnimation 10s infinite alternate;
}

@keyframes backgroundAnimation {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.2);
    }
}

/* 侧边导航栏 */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 200px;
    height: 100%;
    background-color: rgba(255, 182, 193, 0.9); /* 浅粉色背景 */
    padding: 20px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

nav ul {
    list-style: none;
    padding: 0;
}

nav ul li {
    margin: 20px 0;
}

nav ul li a {
    text-decoration: none;
    color: #5e3a4d; /* 深粉色文字 */
    font-size: 1.1rem;
    transition: color 0.3s ease;
}
nav ul li a {
    text-decoration: none;
    color: #5e3a4d; /* 深粉色文字 */
    font-size: 1.1rem;
    transition: color 0.3s ease, background-color 0.3s ease;
    position: relative;
    padding: 10px 15px;
    display: block;
}

/* 鼠标悬停时，文字后方动态出现方块背景 */
nav ul li a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background-color: rgba(255, 105, 180, 0.2); /* 粉色方块背景 */
    z-index: -1;
    transition: width 0.3s ease;
}

nav ul li a:hover::before {
    width: 100%; /* 方块背景完全展开 */
}

nav ul li a:hover {
    color: #ff69b4; /* 文字颜色变化 */
}

/* 点击时的交互动画 */
nav ul li a:active {
    transform: scale(0.95); /* 点击时缩小 */
    transition: transform 0.1s ease;
}

nav ul li a:hover {
    color: #ff69b4; /* 粉色悬停效果 */
}

/* 主要内容区域 */
main {
    margin-left: 240px; /* 留出导航栏空间 */
    padding: 20px;
}

/* 标题样式 */
h1, h2, h3 {
    color: #ff69b4; /* 粉色标题 */
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    animation: fadeIn 2s ease;
}

h2 {
    font-size: 2rem;
    margin-top: 40px;
    margin-bottom: 20px;
}

h3 {
    font-size: 1.5rem;
    margin-top: 10px;
    margin-bottom: 10px;
}

/* 段落样式 */
p {
    font-size: 1.1rem;
    color: #5e3a4d; /* 深粉色文字 */
    margin-bottom: 20px;
}

/* 人物介绍部分 */
#characters div {
    background-color: rgba(255, 255, 255, 0.9); /* 半透明白色背景 */
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#characters div:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

#characters img {
    width: 150px;
    border-radius: 50%;
    display: block;
    margin: 0 auto 10px;
    transition: transform 0.3s ease;
}

#characters img:hover {
    transform: scale(1.1);
}

/* 图片展示部分 */
#gallery div {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

#gallery img {
    width: 400px;
    height: 300px;
    border-radius: 10px;
    object-fit: cover;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#gallery img:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

/* 返回按钮 */
a[href="javascript:history.back()"] {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 20px;
    background-color: #ff69b4; /* 粉色背景 */
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

a[href="javascript:history.back()"]:hover {
    background-color: #ff1493; /* 深粉色悬停效果 */
}

/* 页脚 */
footer {
    text-align: center;
    padding: 20px;
    background-color: rgba(255, 182, 193, 0.9); /* 浅粉色背景 */
    color: #5e3a4d; /* 深粉色文字 */
    margin-top: 40px;
}

/* 动画效果 */
@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}